const express = require("express"); //commonJS   cmd  规范  
const server = express();

server.use(express.static("./public"))

server.set("view engine", "ejs");

server.get("/demo", (req, res) => {
    res.render("demo", {
        "news": ["aaa", "bbb", "ccc"]
    })
})

//设置路由 
server.get("/HELLO/:username", (req, res) => {
    res.send("你好" + req.params.username)
})

//中间件   插件  



server.listen(5000)